package haojie.springbootdemo.repository;

import org.springframework.stereotype.Repository;
import com.baomidou.dynamic.datasource.annotation.DS;
import haojie.springbootdemo.entity.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

@Repository
@DS("test")
public interface EmployeeRepository extends JpaRepository<Employee, Long> {
    @Query(value = "SELECT emp_name FROM test.employees LIMIT 1", nativeQuery = true)
    String findFirstEmployeeName();
}
